<?php
/**
 * Copyright (c) 2006-2007, Julien PORTALIER
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright    Copyright (c) 2006-2007, Julien PORTALIER
 * @link         http://featherphp.googlecode.com/
 * @license      http://www.opensource.org/licenses/mit-license.php The MIT License
 */

/**
 * Regular expressions for data validation.
 */
class Valid
{
	const NotEmpty       = '/.+/';
	const Email          = '/\\A(?:^([a-z0-9][a-z0-9_\\-\\.\\+]*)@([a-z0-9][a-z0-9\\.\\-]{0,63}\\.(com|org|net|biz|info|name|net|pro|aero|coop|museum|[a-z]{2,4}))$)\\z/i';
	const Year           = '/^[0-9]{4}$/';
	const Date           = '/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/';
	const Datetime       = '/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/';
	const DateOrDatetime = '/^([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2})$/';
	const NoPunctuation  = '/^[^().\/\*\^\?#!@$%+=,\"\'><~\[\]{}]+$/';
	const NonZero        = '/^-?[1-9][0-9]*/';
	const Alphanumeric   = '/^[a-zA-Z0-9]+$/';
	const LettersOnly    = '/^[a-zA-Z]+$/';
	const Number         = '/(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/';
}
?>